const template = require('art-template')
const path = require('path')
const dateFormat = require('dateformat')

// const views = path.join(__dirname,'views','index.art')

//设置模板根目录
template.defaults.root = path.join(__dirname,'views')
//设置模板默认后缀
template.defaults.extname = '.art'

/*返回拼接好的字符串*/
template.defaults.imports.dateFormat = dateFormat;

const html = template('index', {
    name: '张三',
    age: 20,
    time :new Date()
});
console.log(html)